Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add clang-format configuration and format sources #420

Merged
merged 5 commits into from
Sep 13, 2023

Conversation

abonnaudet-ledger
Copy link
Member

Description

  • Add clang-format configuration
  • Add pre-commit step to apply formatting
  • Add .git-blame-ignore-revs to ignore formatting commit when blaming

Changes include

  • Bugfix (non-breaking change that solves an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)
  • Tests
  • Documentation
  • Other (for changes that might not fit in any category)

@codecov-commenter
Copy link

Codecov Report

Patch coverage has no change and project coverage change: -0.04% ⚠️

Comparison is base (baf405d) 69.37% compared to head (c209f5e) 69.33%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #420      +/-   ##
==========================================
- Coverage   69.37%   69.33%   -0.04%     
==========================================
  Files          11       11              
  Lines         875      874       -1     
==========================================
- Hits          607      606       -1     
  Misses        268      268              
Flag Coverage Δ
unittests 69.33% <ø> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
lib_nbgl/src/nbgl_fonts.c 65.53% <ø> (+0.11%) ⬆️
lib_nbgl/src/nbgl_obj_pool.c 38.15% <ø> (ø)
lib_nbgl/src/nbgl_screen.c 45.18% <ø> (-0.34%) ⬇️
lib_standard_app/base58.c 87.09% <ø> (ø)
lib_standard_app/bip32.c 83.33% <ø> (ø)
lib_standard_app/buffer.c 91.54% <ø> (ø)
lib_standard_app/format.c 96.73% <ø> (ø)
lib_standard_app/parser.c 92.85% <ø> (ø)
lib_standard_app/read.c 100.00% <ø> (ø)
lib_standard_app/varint.c 36.00% <ø> (ø)
... and 1 more

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@tjoly-ledger tjoly-ledger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job !

Copy link
Contributor

@yrichard-ledger yrichard-ledger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

99.9% OK for me.
It will never be perfect in one go, there are still some places where I prefer the old formatting but overall it's way better than before

Add `.git-blame-ignore-revs`, with the previous code formatting commit.
It allows git blame tools to ignore the specified commits.

Command to configure it:
`git config blame.ignoreRevsFile .git-blame-ignore-revs`
@abonnaudet-ledger abonnaudet-ledger merged commit 81485be into master Sep 13, 2023
151 of 160 checks passed
@abonnaudet-ledger abonnaudet-ledger deleted the abo_clemang_format branch September 13, 2023 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants